"""
中间件模块 - 提供HTTP中间件管理和常用中间件实现
"""

from .logging import (
    LoggingMiddleware,
    PerformanceMiddleware, 
    AccessLogMiddleware,
    create_logging_middleware
)

from .manager import (
    MiddlewarePhase,
    MiddlewarePriority,
    IMiddleware,
    BaseMiddleware,
    MiddlewareConfig,
    MiddlewareChain,
    MiddlewareManager,
    FastAPIMiddlewareAdapter,
    get_middleware_manager,
    middleware
)

from .auth import (
    AuthenticationMethod,
    Permission,
    User,
    AuthContext,
    IAuthProvider,
    IUserProvider,
    JWTAuthProvider,
    APIKeyAuthProvider,
    AuthenticationMiddleware,
    AuthorizationMiddleware,
    RateLimitMiddleware,
    create_jwt_auth_middleware,
    create_api_key_auth_middleware,
    require_auth,
    require_permissions
)

__all__ = [
    # 日志中间件
    "LoggingMiddleware",
    "PerformanceMiddleware",
    "AccessLogMiddleware", 
    "create_logging_middleware",
    
    # 管理器和核心类
    "MiddlewarePhase",
    "MiddlewarePriority", 
    "IMiddleware",
    "BaseMiddleware",
    "MiddlewareConfig",
    "MiddlewareChain",
    "MiddlewareManager",
    "FastAPIMiddlewareAdapter",
    
    # 认证和授权
    "AuthenticationMethod",
    "Permission",
    "User",
    "AuthContext",
    "IAuthProvider",
    "IUserProvider",
    "JWTAuthProvider",
    "APIKeyAuthProvider",
    "AuthenticationMiddleware",
    "AuthorizationMiddleware",
    "RateLimitMiddleware",
    "create_jwt_auth_middleware",
    "create_api_key_auth_middleware",
    "require_auth",
    "require_permissions",
    
    # 函数和装饰器
    "get_middleware_manager",
    "middleware"
]
